package ai.zixing.proxy.example02;

import ai.zixing.proxy.example01.IUserDao;
import ai.zixing.proxy.example01.UserDaoImpl;

public class Client {
    public static void main(String[] args) {
        IUserDao userDao = new UserDaoImpl();
        // 目标对象的信息
        System.out.println(userDao.getClass());
        // 获取代理对象
        IUserDao proxy = (IUserDao) new ProxyFactory(userDao).getProxyInstance();
        System.out.println(proxy.getClass());
        // 代理方法
        proxy.save();
    }
}
